import { _decorator, Component } from 'cc';
import { eventManager } from '../sgame/event/EventManager';
import { SceneManager, SceneMap } from './scene/SceneManager';
import { GameScene } from './scene/GameScene';
const { ccclass, property } = _decorator;

@ccclass('Main')
export class Main extends Component {
    onLoad() {
        eventManager.once("uiroot::init_success", () => {
            let sceneManager = SceneManager.instance();
            let sceneConfig: SceneMap = {
                login: new GameScene("login", "login/prefabs/login", ["login"]),
                hall: new GameScene("hall", "hall/prefabs/hall", ["hall"]),
                wzq: new GameScene("wzq", "wzq/prefabs/wzq", ["wzq"]),
            };

            sceneManager.init(sceneConfig);
            sceneManager.enter("login");
        });
    }
}
